package com.software.car.common.enums;

/**
 *
 * 状态枚举
 *
 * @Author 魔法はまだ解けない
 * @Date 2021/2/24
 */
public enum SimpleStateEnum {

    OK_STATE(1, "正常"),
    DISABLE_STATE(2, "停用"),
    DELETE_STATE(3, "使用中");

    /**
     * id
     */
    private int id;

    /**
     * 描述
     */
    private String description;

    SimpleStateEnum(int id, String description) {
        this.id = id;
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 获取状态描述
     * @param id
     * @return
     */
    public static String getDescription(Integer id) {
        SimpleStateEnum[] values = SimpleStateEnum.values();
        for (SimpleStateEnum modelTypeEnum : values) {
            if(modelTypeEnum.getId()==id){
                return modelTypeEnum.getDescription();
            }
        }
        return null;
    }
}
